package Judge.JudgeMainFrame.JudgeMainFrameView;

import javax.swing.JPanel;
import javax.swing.*;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.JScrollPane;
import java.awt.Component;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.UIManager;
import javax.swing.border.BevelBorder;

import java.awt.GridLayout;
import java.awt.BorderLayout;
import java.awt.FlowLayout;

public class NewRunsPane extends JPanel
{
    public NewRunsPane()
    {
    	try
		{
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		this.setLayout(new BorderLayout());
		
        scrollPane = new JScrollPane();
        scrollPane.setBorder(new BevelBorder(BevelBorder.LOWERED));
        table = new JTable(new NewRunsTableModel());
        table.setBounds(-200, -300, 300, 400);
        scrollPane.getViewport().add(table);
        
        table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
        table.setShowGrid(true);
        table.setEnabled(true);
        table.setDragEnabled(true);
        table.setSize(700, 700);
       
        
        this.requestRunButton = new JButton("Request Run");
        this.southPane = new JPanel();
        this.southPane.setLayout(new FlowLayout());
        this.southPane.add(this.requestRunButton);
        
        this.add(this.scrollPane,BorderLayout.CENTER);
        this.add(southPane, BorderLayout.SOUTH);
    }
    
    public JScrollPane scrollPane;
    
    public JTable table;
    public JPanel southPane;
    
    public JButton requestRunButton;
}
class NewRunsTableModel extends AbstractTableModel
{
	public int getRowCount()
	{
	    return 22;
	}
	public int getColumnCount()
	{
		return 9;
	}
	public Object getValueAt(int row, int column)
	{
		return "";
	}
	public String getColumnName(int column)
	{
		return columnNames[column].toString();
	}
	
	private String columnNames[] = {"Site", "Team", "Run Id", "Time", "Status", "Problem", "Judge", "Language", "OS"};
}